<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>  
<%@include  file="/WEB-INF/jsp/loginFormModal.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
 <head>  
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  <title>电影商城</title>
  <!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap/css/default.css">

<!-- <link rel="stylesheet" href="${pageContext.request.contextPath}/css/carousel.css" > -->
 <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css" >

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="${pageContext.request.contextPath}/js/jquery-1.11.3.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script	src="${pageContext.request.contextPath}/css/bootstrap/js/bootstrap.min.js"></script>
<!-- <script src="${pageContext.request.contextPath}/js/common.js"></script> -->

 </head>
 <body>
<script type="text/javascript">
// $(function(){
//
//         var url=window.location.pathname;
// 	       $("#"+url).addClass('active').siblings().removeClass('active');
// alert(url);
// 	});
//function selectMenu(targeturl){
//	alert(targeturl);
//	 $("#"+targeturl).addClass('active').siblings().removeClass('active');
	//var nowurl=window.location.pathname;
	//if(targeturl=="index"){
	//	$("#index").addClass("active");
	//}else if(targeturl=="saleGoods"){
	//	$("#saleGoods").addClass("active");
	//}else if(targeturl=="newGoods"){
	//	$("#newGoods").addClass("active");
	//}
	
//}
</script>
 <div class="container">

	<div class="row clearfix">
		<div class="col-md-12 ">

 			<ol class="breadcrumb text-right" id="info">
				<c:if test="${sessionScope['_LOGIN_USER_']==null}">
					<c:if test="${USER_SESSION.user_name==null}">
						<li id="li1"><span>游客您好，欢迎来到电影商城！</span>
						<a href="#loginFormModal" data-toggle="modal">[登录]</a>
					</c:if>
					<c:if test="${USER_SESSION.user_name!=null}">
						<li id="li1"><span>${USER_SESSION.user_name}您好，欢迎来到电影商城！</span>	
						<a href="${pageContext.request.contextPath}/logutuser.action">[退出登录]</a>								
					</c:if> 
					 

						<li>
					<a href="${pageContext.request.contextPath }/login.action">
					<i class=""></i>后台管理
					</a>
				</li>
					<li class="dropdown">
						<a class="dropdown-toggle" data-toggle="dropdown" href="#" id="getShopCar">
						购物车
						</a>
						<ul class="dropdown-menu dropdown-alerts">
							<c:choose>
								<c:when test="${not empty sallers}">
									<div class="panel-body">
										<div class="row">
											<c:forEach items="${sallers}" var="saller">
												<li>
													<a href="${pageContext.request.contextPath}/user/goodsDetail.action?produce_id=${saller.produce_id}">
														<div class="media">
															<div class="media-left">
																<img src="${pageContext.request.contextPath}${saller.produce_pic}" class="media-object" style="width:60px">
															</div>
															<div class="media-body">
																<div class="caption caption-style">
																	<p>${saller.produce_name}</p>
																</div>
																<div class="caption caption-style">
																	<p style="background: cyan">${saller.produce_disc}</p>
																</div>
																<div class="caption caption-style" >
																	<p> ${saller.produce_discount}</p>
																</div>
															</div>
														</div>
														<input type="hidden" name="skin_name" value="${saller.produce_name}">
													</a>
												</li>

											</c:forEach>
										</div>
									</div>
								</c:when>
								<c:otherwise>
									<c:choose>
										<c:when test="${not empty USER_SESSION}">
											<li>
												<a class="text-center" href="#">
													<strong>购物车现在还没有东西哟。</strong>
													<i class="fa fa-angle-right"></i>
												</a>
											</li>
										</c:when>
										<c:otherwise>
											<li>
												<a class="text-center" href="#">
													<strong>请先登录再查看购物车。</strong>
													<i class="fa fa-angle-right"></i>
												</a>
											</li>
										</c:otherwise>
									</c:choose>
								</c:otherwise>
							</c:choose>
							<li>
								<a class="text-center" href="/getAllShopCar.action">
									<strong>查看购物车的详情</strong>
									<i class="fa fa-angle-right"></i>
								</a>
							</li>
						</ul>
					</li>
				</c:if>
				<c:if test="${sessionScope['_LOGIN_USER_']!=null}">
					<li id="li1"><span>${sessionScope['_LOGIN_USER_'].userName } 您好，欢迎来到电影商城！</span>
					<li><a href="#" onclick="showCart()">购物车 <span class="badge" id="cartBadge">${fn:length(sessionScope.goodslist)}</span></a></li>
					<li><a href="${pageContext.request.contextPath}/order/getMyOrders">我的订单</a></li>
				<!-- <li><a href="${pageContext.request.contextPath}/usercenter/index">个人中心</a></li> -->	
					<li><a href="#" onclick="logout('${pageContext.request.contextPath}')">退出登录</a></li>
				</c:if>  

			 </ol>
			<nav class="navbar navbar-default" role="navigation">
				<div class="navbar-header">
					 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button> <a class="navbar-brand" href="${pageContext.request.contextPath}/index.action"><span class="logo">电影</span> 商城</a>
				</div>
				
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li <c:if test="${urlKey=='index'}">class="active"</c:if>>
							 <a href="${pageContext.request.contextPath}/index.action">首页</a>
						</li>
						<li <c:if test="${urlKey=='saleGoods'}">class="active"</c:if>>
							 <a href="${pageContext.request.contextPath}/goods/saleGoods.action">热映电影</a>
						</li>
						<li <c:if test="${urlKey=='newGoods'}">class="active"</c:if>>
							 <a href="${pageContext.request.contextPath}/goods/newGoods.action">最新电影</a>
						</li>
						<li <c:if test="${urlKey=='discountGoods'}">class="active"</c:if>>
							 <a href="${pageContext.request.contextPath}/goods/discountGoods.action">假期电影</a>
						</li>
					
						
							<ul class="dropdown-menu">
							   <c:forEach items="${shortlist}" var="c" varStatus="vs">								   
							  			<li><a href="${pageContext.request.contextPath}/goods/goodsCate.action?cateid=${c.cateId}">${c.cateName}</a></li>
						            <li class="divider"><>							
							   </c:forEach>						
							</ul>
						</li>
					</ul>
					<form class="navbar-form navbar-left" role="search" action="#">
						<div class="form-group">
							<input type="text" class="form-control" />
						</div> 
						<button type="submit" class="btn btn-default">搜索</button>
					</form>
					<ul class="nav navbar-nav navbar-right">

						<li class="dropdown">
							 <a href="#" class="dropdown-toggle" data-toggle="dropdown">排序<strong class="caret"></strong></a>
							<ul class="dropdown-menu">
								<li>
									 <a href="#">按价格从低到高</a>
								</li>
								<li>
									 <a href="#">按价格从高到低</a>
								</li>
								<li class="divider"></li>
								<li>
									 <a href="#">按销量从高到低</a>
								</li>
								<li>
									 <a href="#">按销量从低到高</a>
								</li>
							</ul>
						</li>
					</ul>
				</div>
				
			</nav>